﻿using System.Text.Json.Serialization;

namespace Digitalmes.ControlEx;

/// <summary>
/// LED 点
/// </summary>
public sealed class LedPoint
{
    /// <summary>
    /// 圆直径
    /// </summary>
    public int Diameter { get; set; }

    /// <summary>
    /// 显示文本
    /// </summary>
    public string? Text { get; set; }

    /// <summary>
    /// 显示文本颜色
    /// </summary>
    public string? TextColor { get; set; }

    /// <summary>
    /// 显示文本字体大小
    /// </summary>
    public double? TextFontSize { get; set; }

    /// <summary>
    /// 索引编号
    /// </summary>
    public int Index { get; set; }

    /// <summary>
    /// 编号分组，默认为空。
    /// </summary>
    [NotNull]
    public string? Group { get; set; } = string.Empty;

    /// <summary>
    /// LED 状态
    /// </summary>
    [JsonConverter(typeof(JsonStringEnumConverter))]
    public LedState State { get; set; } = LedState.None;

    /// <summary>
    /// <see cref="LedState.None"/> 状态颜色
    /// </summary>
    public string? NoneStateColor { get; set; }

    /// <summary>
    /// <see cref="LedState.OK"/> 状态颜色
    /// </summary>
    public string? OkStateColor { get; set; }

    /// <summary>
    /// <see cref="LedState.NG"/> 状态颜色
    /// </summary>
    public string? NgStateColor { get; set; }

    /// <summary>
    /// 画布 X 轴（左上顶点）
    /// </summary>
    public double X { get; set; }

    /// <summary>
    /// 画布 Y 轴（左上顶点）
    /// </summary>
    public double Y { get; set; }
}
